<?php
/**
 * @Author: speakphp
 * @Date:   2015-09-18 21:20:24
 * @Last Modified by:   Awe
 * @Last Modified time: 2015-10-18 16:09:40
 */
class InfoAction extends IsloginAction {
    public function __construct(){
        parent::__construct();  
    }
    public function editpwd(){
        $action = $this->_request("action"); 
        $action_array = array("show","doedit");
        $action = !in_array($action,$action_array)?'show':$action ;
        if($action == 'show' ){
            $this->display();
        }elseif($action == 'doedit' ){
            $this->doedit();
        }
       
    }
    private function doedit(){
        $newpwd = trim($this->_request("newpwd"));
        $repwd = trim($this->_request("repwd")); 
        $d = D("Admin/Info");
        $re = $d->editpwd($newpwd , $repwd);
        $url = U("login/login_out") ;
        if($re['status']){
            echo "<script>parent.parent.window.location.href='{$url}';</script>";
        }else{
            throw_exception($re['message']);
        }
    }
   
 
}